<?php
$filepath = "res/claim_logo.gif";
$dirIter = new DirectoryIterator("res");
foreach($dirIter as $iter){
    $filepath = $iter->getPathname();
    if(is_file($filepath)){
        echo "--------------------------\n";

        $filetype = exif_imagetype($filepath);
        echo $filetype;
        $exif = exif_read_data($filepath, "IFDO");
        echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />\n";


        foreach($exif as $key=>$section){
            foreach($section as $name=>$val){
                echo "$key.$name: $val<br />\n";
            }
        }
    }
}

/* Create new Imagick object */
$im = new imagick("");
$im->setImageFormat("gif");

/* Create an empty image */
$im->newImage(100, 100, new ImagickPixel("red"));

/* Add comment to the image */
$im->commentImage("Hello World!");

/* Display the comment */
echo $im->getImageProperty("comment");
?> 
